Repository navigation
fix(cache): stop skipping dist in directory listings - #919
Merged
wan9chi merged 2 commits intoNov 5, 2026
Merged
Conversation
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
October 30, 2026 03:19
7df8d21 to
0d60891
Compare
fspy benchmarklinuxmacoswindows |
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
October 30, 2026 04:06
0d60891 to
dbd1644
Compare
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
October 30, 2026 06:31
dbd1644 to
4e828d2
Compare
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
October 30, 2026 07:08
4e828d2 to
992cd6a
Compare
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
November 1, 2026 11:55
992cd6a to
5b6b3b8
Compare
wan9chi
changed the base branch from
feat/cache-created-symlinks
to
feat/cache-input-negatives-in-listings
November 5, 2026 08:53
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
November 5, 2026 08:54
5b6b3b8 to
6d1f47f
Compare
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
November 5, 2026 09:03
6d1f47f to
0c75118
Compare
…unseen Two cases for a task that lists a folder in which a `dist` folder it didn't write appears later. In `dist_appears_in_listed_folder`, the task lists the package root with `vtt list-dir .` and prints its entries. In `oxlint_dist`, `oxlint -D no-debugger` lints a package whose `.gitignore` lists `node_modules` but not `dist/`, like a GitHub Action that commits its built `dist/`: it lists the package root, `src` and, once there, `dist`, and reads the files in them. Today every listing skips an entry named `dist`, so a new `dist` folder in the listed root goes unseen and the next run is a cache hit: the first case replays the old listing without `dist`, and the second passes although `dist/bad.js` holds a `debugger` statement. The oxlint fixture ignores `node_modules` as a real package would; otherwise oxlint walks into vp's task cache in `node_modules/.vite`, whose files change between runs. The oxlint steps redact oxlint's rule count, which changes between oxlint releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every directory listing fingerprint skipped an entry named `dist`. It was added in #181 so that a lint task listing a folder, like the package root, stayed a cache hit when a `dist` folder it didn't write, such as another task's build output, appeared there. It helped no other folder name and hid a `dist` that does matter: a `dist` folder appearing in or disappearing from a folder the task listed went unseen, and the next run was a cache hit replaying stale output, like `oxlint` passing after a `dist` folder with lint errors appeared in a package that commits its built `dist/`. Listings now skip only `.`, `..` and `.DS_Store`. A task that should ignore another task's `dist` gets that back with `"!dist/**"` in its `input`, since input negatives now keep matching entries out of listings. A task's own `dist` output folder doesn't need the skip: a folder holding only what the task can rebuild is an ignored entry of the listing, so it may be missing. No other snapshot changes, including `typescript_out_dir` and `astro_empty_collections`, whose tasks list the folder holding their own `dist`. The cache schema version is bumped: an entry recorded with the skip holds listings without `dist`, which would otherwise be a hit after a `dist` folder the task listed went away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wan9chi
force-pushed
the
fix/cache-dist-in-listings
branch
from
November 5, 2026 09:17
0c75118 to
625af30
Compare
wan9chi
added a commit
that referenced
this pull request
Nov 5, 2026
…gs (#941) ## Motivation An exclusion in a task's `input`, like `"!build/**"`, leaves out only the paths the task reads. When the task lists a folder, every entry still counts, so an excluded folder appearing there is a cache miss: a lint task listing the package root misses once another task's build output appears in it. That is the case the hard-coded `dist` skip was added for (#181). #919 removes the skip, so users need a setting to get it back, and today `"!dist/**"`, which `docs/inputs.md` recommends, doesn't help. ## Changes Listings leave out what the input config excludes, after the entries the task can rebuild (#915): - An entry whose path the input negative globs match. A folder entry is matched by its own path; wax's `**` matches zero or more components, so `build/**` leaves out `build`, while `build/*` keeps it. The globs are part of the cache key, so validation applies the same ones to the current listing, and an entry that appears after the run is left out too. - An entry that a tool-reported `ignoreInput` path names. Those paths are known only after the run, so the names are recorded in the listing's `ignored_entries`, including entries that aren't there yet. The cache schema version is bumped. `docs/inputs.md` now says negatives also keep entries out of listings. E2E cases: `negative_glob_hides_listing_entry` (synthetic, `vtt list-dir` with `"!out/**"`; an unrelated new file still misses) and `oxlint_negative_build` (`oxlint -D no-debugger` with a gitignored `build/` and `"!build/**"`). Both miss today and hit after. A unit test covers `ignoreInput`. Part of a stack that lets automatic tracking cache tasks which read their own outputs and list the folders holding them, so they also hit on a clean checkout. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes post-run fingerprint semantics and cache validation for any task that lists directories with input negatives or ignoreInput; incorrect glob matching could cause stale cache hits, mitigated by schema bump and targeted tests. > > **Overview** > **Input exclusions now apply to directory listings**, not only to paths the task reads. Tasks that list a folder (e.g. a linter scanning the package root) no longer miss the cache when an excluded entry appears—such as another task’s `build/` folder after `"!build/**"`—as long as nothing else in the listing changed. > > Post-run fingerprints **omit listing entries** matched by the task’s input negative globs (same rules as reads: `build/**` drops the `build` folder entry; `build/*` does not) and by tool **`ignoreInput`** paths (names recorded in `ignored_entries` for validation). Cache hits recompile those globs from the entry key and apply the same filters when comparing listings. > > **Cache schema version is bumped to v22** (fresh cache). Docs and changelog describe the behavior; e2e covers `!out/**` with `list-dir` and an oxlint + `!build/**` scenario, plus a unit test for globs and `ignoreInput`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0655edb. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
wan9chi
added a commit
that referenced
this pull request
Nov 5, 2026
## Motivation Follow-ups to the rebuildable-inputs stack (#913–#919, #940, #941), now merged: - The real-world case for files renamed into place (#916) used Vitest's `fsModuleCache`, which renames cache entries rather than outputs. - #919's e2e cases test a listing entry like any other, so they add no coverage of their own. - The stack added eight changelog entries, most of them for what users see as one feature. - Socket flagged Astro 6.4.8, which #917 added for its real-world case: critical advisory GHSA-26w7-cxv4-gfx2 (remote code execution through AVIF image optimization), fixed in Astro 7.2.8. ## Changes - New case `next_build_moved_pages`: Next.js 15's `next build` renders each static page (`index.html`, `404.html`, `500.html`) into `.next/export` and renames it into `.next/server/pages`. After `.next` is removed, the next run is a cache hit that restores the pages. The build log is redacted, since its progress lines, sizes and chunk hashes vary. It replaces `vitest_fs_module_cache`, along with the SHA-1 redaction only that case used. `next`, `react` and `react-dom` join `packages/tools`. - `dist_appears_in_listed_folder` and `oxlint_dist` are removed. - The changelog entries of #913–#918 are combined into one **Added** item for rebuildable inputs; #919 (`dist` in listings) and #941 (input exclusions apply to listings) stay their own short items, and so does #940's fix. - On Windows CI, the e2e harness stages fixtures in `RUNNER_TEMP`, on the checkout's drive: the staged workspaces resolve `node_modules` into the checkout, and Next.js builds its client entry from a path relative to the project, which can't cross drives. - Astro 6.4.8 → 7.3.8, the newest release that still supports the repo's Node 22.19. Astro 7 needs upstream Vite 8, so its scoped override now points at Vite 8.3.2. `astro_empty_collections` passes unchanged; its comment now says Astro 7 stats the project root rather than listing it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test harness, changelog, and dependency catalog changes only; no changes to task caching or file-tracking behavior in this diff. > > **Overview** > Follow-up after the rebuildable-inputs stack lands: **no runtime cache logic changes**—mostly release notes, snapshot tests, and toolchain bumps. > > The **changelog** folds the former #913–#918 narrative into one **Added** “rebuildable inputs” entry and shortens the #919 / #941 **Changed** bullets; #940 stays separate. > > **E2E snapshots** swap coverage: **`next_build_moved_pages`** (Next.js 15 renaming `.next/export` → `.next/server/pages`, cache hit after deleting `.next`) replaces **`vitest_fs_module_cache`**; **`dist_appears_in_listed_folder`** and **`oxlint_dist`** are dropped as redundant with listing behavior elsewhere. Snapshot **redaction** drops SHA-1 normalization (Vitest-only). On **Windows CI**, fixtures stage under **`RUNNER_TEMP`** so Next’s client entry paths stay on the checkout drive. > > **Deps**: catalog adds **Next 15**, **React 19**, bumps **Astro 6 → 7.3.8** (security advisory), and scopes **`astro>vite`** to upstream **Vite 8.3.2**. The Astro empty-collections fixture comment reflects Astro 7 **stat**-ing the project root instead of listing it. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4c8f40c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Every directory listing skips an entry named
dist. #181 added the skip so that a lint task listing the package root stays a cache hit when another task's build createsdistthere. It helps no other folder name and hides adistthat does matter. Adistfolder appearing in a folder the task listed goes unseen, and the next run replays stale output:oxlint, for example, passes from the cache after adistfolder with lint errors appears.Changes
Listings skip only
.,..and.DS_Store. A task that should ignore another task'sdistgets that back with"!dist/**"in itsinput, which keeps the entry out of its listings since #941. A task's owndistdoesn't need the skip, since #915 makes a rebuildable folder an ignored entry. The cache schema version is bumped, so entries recorded with the skip aren't reused. No other snapshot changes.E2E cases:
dist_appears_in_listed_folder(synthetic,vtt list-dir) andoxlint_dist(oxlint -D no-debugger, with oxlint's rule count redacted). Both are false hits today and correct misses after.Part of a stack that lets automatic tracking cache tasks which read their own outputs and list the folders holding them, so they also hit on a clean checkout.
🤖 Generated with Claude Code
Note
Medium Risk
Changes cache fingerprint semantics for any task that lists directories, which can increase cache misses but fixes incorrect hits; schema bump invalidates existing local cache entries for the new version directory.
Overview
Directory listings for cache fingerprints no longer always omit a
distentry. Only.,.., and.DS_Storeare skipped when fingerprinting folder contents, so adistfolder appearing or disappearing in a listed directory now triggers a cache miss instead of replaying stale results (e.g. oxlint passing after bad code lands in a committeddist/).To keep ignoring another task’s
dist, tasks can use"!dist/**"ininput(listing exclusions from #941). A task’s own outputdiststill doesn’t affect listings when it only holds rebuildable outputs (#915).CACHE_SCHEMA_VERSIONis bumped 22 → 23 so old fingerprints aren’t reused.E2E coverage adds
dist_appears_in_listed_folderandoxlint_distsnapshots for the new miss behavior.Reviewed by Cursor Bugbot for commit 625af30. Bugbot is set up for automated code reviews on this repo. Configure here.